<include file="Public:header"/>
<div id="main-content">
	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
		<button class="close fixed" style="margin-top: 4px;">&times;</button>
		<div class="alert-content">警告内容</div>
	</div>
	<div id="main" class="main">
		<div class="main-title-h">
			<span class="h1-title">委托管理</span>
		</div>
		<div class="cf">
			<div class="fl">
				<button class="btn btn-warning" onClick="location.href='{:U('Ptpbc/index')}'">初始化搜索</button>
				<button class="btn btn-warning" onClick="location.href='{:U('Ptpbc/add')}'">添加交易</button>
			</div>

			<div class="search-form fr cf" style="padding-top: 43px;float: none !important;">
				<div class="sleft">
					<form name="formSearch" id="formSearch" method="get" name="form1">

						<select style="width: 160px; float: left; margin-right: 10px;" name="lang" class="form-control">
							<option value=""
							<empty name="Think.get.lang">selected</empty>
							>适用语言</option>
							<volist name="__LANG__" id="v">
								<option value="{$key}"
								<eq name="data['lang']" value="$key">selected</eq>
								>{$v}</option>
							</volist>
						</select>

						<select style="width: 160px; float: left; margin-right: 10px;" name="market" class="form-control">
							<option value=""
							<empty name="Think.get.market">selected</empty>
							>交易市场</option>
							<volist name="C['PTP_MARKET']" id="vo">
								<option value="{$vo}"
								<eq name="vo" value="$Think.get.market">selected</eq>
								>{:L($vo)}</option>
							</volist>
						</select>
						<input type="text" name="merchant" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
					</form>
					<script>
						//搜索功能
						$(function () {
							$('#search').click(function () {
								$('#formSearch').submit();
							});
						});
						//回车搜索
						$(".search-input").keyup(function (e) {
							if (e.keyCode === 13) {
								$("#search").click();
								return false;
							}
						});
					</script>
				</div>
			</div>
		</div>
		<div class="data-table table-striped">
			<table class="">
				<thead>
				<tr>
					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
					<th class="">ID</th>
					<th class="">商户名</th>
					<th class="">国籍</th>
					<th class="">市场</th>
					<th class="">单价</th>
					<th class="">交易限额</th>
					<th class="">交易方式</th>
					<th class="">操作</th>
				</tr>
				</thead>
				<tbody>
				<notempty name="list">
					<volist name="list" id="vo">
						<tr>
							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
							<td>{$vo.id}</td>
							<td>{$vo['merchant']}</td>
							<td>{$C['NATION'][$vo['nation']]}</td>
							<td>{$vo['market']}</td>
							<td>{$vo['price']|Num} {$vo['unit']}</td>
							<td>{$vo['quota']}</td>
							<td>{$vo['payments']}</td>
							<td>
								<a href="{:U('Ptpbc/edit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑 </a>
								<a href="{:U('Ptpbc/del?id='.$vo['id'])}" class="btn btn-primary btn-xs">删除 </a>
							</td>
						</tr>
					</volist>

						<tr>
							<td colspan="12">
								合计统计&nbsp;&nbsp;&nbsp;
								数量：{$datas['num_zong']}&nbsp;&nbsp;
								已成交：{$datas['num_cj_zong']}&nbsp;&nbsp;
								总额：{$datas['money_zong']}
							</td>
						</tr>



					<else/>
					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
				</notempty>
				</tbody>
			</table>
			<div class="page">
				<div>{$page}</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(".page > div").children("a").each(function(){
		var ahref = $(this).attr('href');
		var ahrefarr = ahref.split("/");
		var ahlength = ahrefarr.length;
		var newhref = '';
		for(var i=0;i<ahlength;i++){
			if(i<3 && i>0){
				newhref += "/"+ahrefarr[i];
			}
			if(i==3){
				newhref += "/"+ahrefarr[i]+".html?";
			}
			if(i>=4 && i%2==0){
				newhref += "&"+ahrefarr[i]+"="+ahrefarr[i+1];
			}
		}
		$(this).attr("href",newhref);
	});
</script>
<include file="Public:footer"/>
<block name="script">
	<script type="text/javascript" charset="utf-8">
		//导航高亮
		highlight_subnav("{:U('Ptpbc/index')}");
	</script>
</block>